﻿using System;
using System.Runtime.Serialization;

namespace QuailDashboard.View.Web
{
    /// <summary>
    /// The network traffic data class
    /// </summary>
    [DataContract]
    public class NetworkTrafficData
    {
        /// <summary>
        /// Gets or sets the status code.
        /// </summary>
        /// <value>The status code.</value>
        [DataMember]
        public short StatusCode { get; set; }

        /// <summary>
        /// Gets or sets the method.
        /// </summary>
        /// <value>The method.</value>
        [DataMember]
        public string Method { get; set; }

        /// <summary>
        /// Gets or sets the URL.
        /// </summary>
        /// <value>The URL.</value>
        [DataMember]
        public string Url { get; set; }

        /// <summary>
        /// Gets or sets the bytes sent during the transaction
        /// </summary>
        /// <value>The bytes.</value>
        [DataMember]
        public int Bytes { get; set; }

        /// <summary>
        /// Gets or sets the start time.
        /// </summary>
        [DataMember]
        public DateTime Start { get; set; }

        /// <summary>
        /// Gets or sets the end time.
        /// </summary>
        [DataMember]
        public DateTime End { get; set; }

        /// <summary>
        /// Gets or sets the time in millis.
        /// </summary>
        [DataMember]
        public int TimeInMillis { get; set; }

        /// <summary>
        /// Gets or sets the request headers.
        /// </summary>
        [DataMember]
        public Headers[] RequestHeaders { get; set; }

        /// <summary>
        /// Gets or sets the response headers.
        /// </summary>
        /// <value>The response headers.</value>
        [DataMember]
        public Headers[] ResponseHeaders { get; set; }

        /// <summary>
        /// Request or Response headers
        /// </summary>
        [DataContract]
        public class Headers
        {
            /// <summary>
            /// Gets or sets the name.
            /// </summary>
            /// <value>The name.</value>
            [DataMember]
            public string Name { get; set; }

            /// <summary>
            /// Gets or sets the value.
            /// </summary>
            /// <value>The value.</value>
            [DataMember]
            public string Value { get; set; }
        }
    }
}